package com.block.source.service.receive;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.block.common.enums.BaseTypeInfoEnum;
import com.block.common.enums.InfoTypeEnum;
import com.block.common.enums.ProfitSharingEnum;
import com.block.common.model.vo.ResultInfoVO;
import com.block.common.service.IAddressInfoService;
import com.block.common.service.IApplicationInfoService;
import com.block.common.service.IChannelCommonService;
import com.block.db.entity.*;
import com.block.db.mapper.SourcePushResultInfoMapper;
import com.block.source.model.api.JinYaoDaiParam;
import com.block.source.model.dto.SourceApiParam;
import com.block.source.model.dto.SourceApiResult;
import com.block.source.model.param.UserDataParam;
import com.block.source.service.ISourceReceiveService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.UUID;

@Service
public class JinYaoDaiReceiveService extends ISourceReceiveService {

    @Autowired
    IAddressInfoService addressInfoService;
    @Resource
    SourcePushResultInfoMapper sourcePushResultInfoMapper;
    @Autowired
    IChannelCommonService channelCommonService;
    @Autowired
    IApplicationInfoService applicationInfoService;


    @Override
    public SourceApiResult handleCheckUserData(SourceBaseInfo sourceBaseInfo, Map<String, String[]> parameterMap, String paramContent) {
        SourceApiResult sourceApiResult = new SourceApiResult();
        sourceApiResult.setSuccess(false);

        String apiSecret = sourceBaseInfo.getApiSecret();

        JSONObject jsonObjectParamContent = JSONObject.parseObject(paramContent);
        if (ObjectUtil.isEmpty(jsonObjectParamContent)){
            sourceApiResult.setReturnObject(this.getError("撞库传入的信息为空"));
            return sourceApiResult;
        }

        String requestNo = jsonObjectParamContent.getString("requestNo");
        JSONObject jsonObject1 = new JSONObject();
        jsonObject1.put("requestNo",requestNo);
        sourceApiResult.setExtObject(jsonObject1);

        String tranData = jsonObjectParamContent.getString("tranData");
        String paramContentData = SecureUtil.aes(apiSecret.getBytes()).decryptStr(tranData);
        JSONObject jsonObject = JSONObject.parseObject(paramContentData);
        //过滤
        if (StrUtil.isEmpty(jsonObject.getString("mobileMd5")) ||
                StrUtil.isEmpty(jsonObject.getString("realName")) ||
                StrUtil.isEmpty(jsonObject.getString("age")) ||
                StrUtil.isEmpty(jsonObject.getString("sex")) ||
                StrUtil.isEmpty(jsonObject.getString("city")) ||
                StrUtil.isEmpty(jsonObject.getString("cityCode")) ||
                StrUtil.isEmpty(jsonObject.getString("province")) ||
                StrUtil.isEmpty(jsonObject.getString("provinceCode")) ||
                StrUtil.isEmpty(jsonObject.getString("userIp")) ||
                StrUtil.isEmpty(jsonObject.getString("loanAmount")) ||
                StrUtil.isEmpty(jsonObject.getString("loanTime")) ||
                StrUtil.isEmpty(jsonObject.getString("house")) ||
                StrUtil.isEmpty(jsonObject.getString("car")) ||
                StrUtil.isEmpty(jsonObject.getString("gjj")) ||
                StrUtil.isEmpty(jsonObject.getString("shebao")) ||
                StrUtil.isEmpty(jsonObject.getString("baoxian")) ||
                StrUtil.isEmpty(jsonObject.getString("zhimaSource")) ||
                StrUtil.isEmpty(jsonObject.getString("salary")) ||
                StrUtil.isEmpty(jsonObject.getString("xueli")) ||
                StrUtil.isEmpty(jsonObject.getString("yongtu")) ||
                StrUtil.isEmpty(jsonObject.getString("yuqi")) ||
                StrUtil.isEmpty(jsonObject.getString("gongzuo")) ||
                StrUtil.isEmpty(jsonObject.getString("enterpriseOwner")) ||
                StrUtil.isEmpty(jsonObject.getString("outOrderNo"))){
            sourceApiResult.setReturnObject(this.getError1(requestNo,"撞库传入的信息有空值"));
            return sourceApiResult;
        }

        UserDataParam userDataParam = this.getUserDataParam(paramContentData);

        // 获取城市信息
        AddressInfo addressInfo = addressInfoService.getAddressInfoByCityCode(userDataParam.getCityCode());
        if (ObjectUtil.isEmpty(addressInfo)) {
            sourceApiResult.setReturnObject(this.getError1(requestNo,"城市信息为空"));
            return sourceApiResult;
        }

        // 设置省市信息
        userDataParam.setCityCode(addressInfo.getCityCode());
        userDataParam.setCity(addressInfo.getCity());
        userDataParam.setProvinceCode(addressInfo.getProvinceCode());
        userDataParam.setProvince(addressInfo.getProvince());
        sourceApiResult.setUserDataParam(userDataParam);
        sourceApiResult.setSuccess(true);

        return sourceApiResult;
    }

    @Override
    public SourceApiResult handleRegisterUserData(SourceBaseInfo sourceBaseInfo, Map<String, String[]> parameterMap, String paramContent) {

        SourceApiResult sourceApiResult = new SourceApiResult();
        sourceApiResult.setSuccess(false);

        String apiSecret = sourceBaseInfo.getApiSecret();

        JSONObject jsonObjectParamContent = JSONObject.parseObject(paramContent);
        if (ObjectUtil.isEmpty(jsonObjectParamContent)){
            sourceApiResult.setReturnObject(this.getError("进件传入的信息为空"));
            return sourceApiResult;
        }
        String requestNo = jsonObjectParamContent.getString("requestNo");
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("requestNo",requestNo);
        sourceApiResult.setExtObject(jsonObject);


        String tranData = jsonObjectParamContent.getString("tranData");
        String paramContentData = SecureUtil.aes(apiSecret.getBytes()).decryptStr(tranData);

        JinYaoDaiParam jinYaoDaiParam = JSON.parseObject(paramContentData, JinYaoDaiParam.class);

        UserDataParam userDataParam = this.getUserDataParam(paramContentData);

        userDataParam.setMobile(jinYaoDaiParam.getMobile());
        userDataParam.setRealName(jinYaoDaiParam.getRealName());

        String productId = jinYaoDaiParam.getProductId();
        SourcePushResultInfo pushResultInfo = sourcePushResultInfoMapper.selectByChannelCodeAndOutOrderNo(sourceBaseInfo.getChannelCode(), productId);
        userDataParam.setOrderNo(String.valueOf(pushResultInfo.getId()));

        sourceApiResult.setUserDataParam(userDataParam);
        sourceApiResult.setSuccess(true);

        return sourceApiResult;
    }

    @Override
    public SourceApiResult getCheckUserReturnData(SourceBaseInfo sourceBaseInfo, ResultInfoVO resultInfoVO, SourceApiParam sourceApiParam) {


        SourceApiResult sourceApiResult = new SourceApiResult();

        MerchantBaseInfo merchantBaseInfo = sourceApiParam.getMerchantBaseInfo();
        SourcePushResultInfo pushResultInfo = sourceApiParam.getSourcePushResultInfo();
        MerchantThirdBaseInfo thirdBaseInfo = sourceApiParam.getThirdBaseInfo();
        List<MerchantThirdProtocolInfo> thirdProtocolInfoList = sourceApiParam.getThirdProtocolInfoList();

        String outOrderNo = pushResultInfo.getOutOrderNo();


        JSONObject extObject = sourceApiParam.getExtObject();
        String requestNo = extObject.getString("requestNo");

        JSONObject returnObject = new JSONObject();
        returnObject.put("requestNo",requestNo);
        returnObject.put("respCode","200");
        returnObject.put("respMsg","撞库成功");
        JSONObject dataObject = new JSONObject();
        JSONArray jsonArray = new JSONArray();

        dataObject.put("orderNo", UUID.randomUUID().toString());
        dataObject.put("outOrderNo", outOrderNo);
//        dataObject.put("maxLoanAmount", "200000");
//        dataObject.put("maxLoanRate", "12");
//        dataObject.put("minLoanRate", "2");
        dataObject.put("businessInfo", "信用贷款");

        // 推送原价(分润渠道返回，固价渠道不返回)
        BigDecimal priceAmount = BigDecimal.ZERO;
        if (ObjectUtil.equals(ProfitSharingEnum.PROFITPRICE.getValue(),sourceBaseInfo.getPriceType())){
            priceAmount = pushResultInfo.getPriceAmount();//分润前价格
        }
        dataObject.put("price", priceAmount);

        if (StrUtil.equals(merchantBaseInfo.getInfoType(), InfoTypeEnum.APIS.getValue()) ){

            // 下游是 非 apis 类型
            dataObject.put("companyName", thirdBaseInfo.getCompanyName());
            String companyLogo = thirdBaseInfo.getCompanyLogo();
            if (StringUtils.isEmpty(companyLogo)){
                dataObject.put("companyLogo", "");
            }else {
                dataObject.put("companyLogo", companyLogo);
            }

            dataObject.put("productName", thirdBaseInfo.getProductName());
            dataObject.put("productId", pushResultInfo.getOutOrderNo());

            //协议地址
            for (MerchantThirdProtocolInfo protocolInfo : thirdProtocolInfoList) {
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("protocalName",protocolInfo.getProtocolName());
                jsonObject.put("protocalUrl", protocolInfo.getProtocolUrl());
                jsonArray.add(jsonObject);
            }
        }else{
            // 下游是 非 apis 类型
            dataObject.put("companyName", merchantBaseInfo.getCompanyName());
            String companyLogo = merchantBaseInfo.getCompanyLogo();
            if (StringUtils.isEmpty(companyLogo)){
                dataObject.put("companyLogo", "");
            }else {
                dataObject.put("companyLogo", merchantBaseInfo.getCompanyLogo());
            }

            dataObject.put("productName", merchantBaseInfo.getInfoName());
            dataObject.put("productId", pushResultInfo.getOutOrderNo());


            //协议地址

            JSONObject jsonObject = new JSONObject();
            ChannelBaseInfo baseInfoByCode = channelCommonService.getBaseInfoByCode(sourceBaseInfo.getChannelCode());
            ApplicationInfo appInfoByAppCode = applicationInfoService.getAppInfoByAppCode(baseInfoByCode.getAppCode());
            String protocolUrl = StrUtil.format("{}/page/newprotocol/{}/{}.html", appInfoByAppCode.getApiUrl(), pushResultInfo.getOrderNo(), pushResultInfo.getOrderItemNo());
            jsonObject.put("protocalName","授权协议");
            jsonObject.put("protocalUrl", protocolUrl);
            jsonArray.add(jsonObject);
        }




        dataObject.put("protocalList", jsonArray);
        returnObject.put("respData", dataObject);
        sourceApiResult.setReturnObject(returnObject);

        return sourceApiResult;
    }

    @Override
    public SourceApiResult getRegisterUserReturnData(SourceBaseInfo sourceBaseInfo, ResultInfoVO resultInfoVO,SourceApiParam sourceApiParam) {
        SourceApiResult sourceApiResult = new SourceApiResult();

        JSONObject returnObject = new JSONObject();
        JSONObject extObject = sourceApiParam.getExtObject();
        String requestNo = extObject.getString("requestNo");

        JSONObject data = resultInfoVO.getData();
        String respCode = resultInfoVO.getRespCode();

        if (StrUtil.equals(respCode, "200") && resultInfoVO.isSuccess()){
            String status = data.getString("status");
            if (StrUtil.equals(status, "000")){
                returnObject = this.getSuccess1(requestNo);
                sourceApiResult.setReturnObject(returnObject);
                return sourceApiResult;
            }
        }

        returnObject = this.getError1(requestNo,"推送失败");
        sourceApiResult.setReturnObject(returnObject);

        return sourceApiResult;
    }

    @Override
    public JSONObject getError(String message) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("requestNo","");
        jsonObject.put("respCode","500");
        jsonObject.put("respMsg",message);
        JSONObject respData = new JSONObject();
        jsonObject.put("respData",respData);
        return jsonObject;
    }

    @Override
    public JSONObject getSuccess() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("requestNo","");
        jsonObject.put("respCode","200");
        jsonObject.put("respMsg","请求成功");
        JSONObject returnObject = new JSONObject();
        returnObject.put("status", "000");
        returnObject.put("message", "推送成功");
        returnObject.put("orderNo", UUID.randomUUID().toString());
        jsonObject.put("respData",returnObject);
        return jsonObject;
    }

    @Override
    public UserDataParam getUserDataParam(String paramContent) {

        JinYaoDaiParam jinYaoDaiParam = JSON.parseObject(paramContent, JinYaoDaiParam.class);

        UserDataParam userDataParam = new UserDataParam();

        userDataParam.setOutOrderNo(jinYaoDaiParam.getOutOrderNo());

        userDataParam.setMobileMd5(jinYaoDaiParam.getMobileMd5());
        userDataParam.setMobile(jinYaoDaiParam.getMobile());
        userDataParam.setRealName(jinYaoDaiParam.getRealName());

        userDataParam.setSex(jinYaoDaiParam.getSex());

        userDataParam.setAge(Integer.valueOf(jinYaoDaiParam.getAge()));

        userDataParam.setCity(jinYaoDaiParam.getCity());

        userDataParam.setCityCode(jinYaoDaiParam.getCityCode());

        userDataParam.setXinyongka(BaseTypeInfoEnum.XinYongKa.xyk001.getValue());

        userDataParam.setWeili(BaseTypeInfoEnum.WeiLi.wl001.getValue());

        if (StringUtils.isEmpty(jinYaoDaiParam.getYongtu())){
            userDataParam.setYongtu(BaseTypeInfoEnum.Yongtu.yt007.getValue());
        }else if ("pu001".equals(jinYaoDaiParam.getYongtu())){
            userDataParam.setYongtu(BaseTypeInfoEnum.Yongtu.yt002.getValue());
        }else if ("pu003".equals(jinYaoDaiParam.getYongtu())){
            userDataParam.setYongtu(BaseTypeInfoEnum.Yongtu.yt001.getValue());
        }else if ("pu004".equals(jinYaoDaiParam.getYongtu())){
            userDataParam.setYongtu(BaseTypeInfoEnum.Yongtu.yt005.getValue());
        }else if ("pu005".equals(jinYaoDaiParam.getYongtu())){
            userDataParam.setYongtu(BaseTypeInfoEnum.Yongtu.yt003.getValue());
        }else if ("pu006".equals(jinYaoDaiParam.getYongtu())){
            userDataParam.setYongtu(BaseTypeInfoEnum.Yongtu.yt004.getValue());
        }else {
            userDataParam.setYongtu(BaseTypeInfoEnum.Yongtu.yt007.getValue());
        }

        if (StringUtils.isEmpty(jinYaoDaiParam.getXueli())){
            userDataParam.setXueli(BaseTypeInfoEnum.XueLi.xl001.getValue());
        }else if ("xl001".equals(jinYaoDaiParam.getXueli())){
            userDataParam.setXueli(BaseTypeInfoEnum.XueLi.xl001.getValue());
        }else if ("xl002".equals(jinYaoDaiParam.getXueli())){
            userDataParam.setXueli(BaseTypeInfoEnum.XueLi.xl002.getValue());
        }else if ("xl003".equals(jinYaoDaiParam.getXueli())){
            userDataParam.setXueli(BaseTypeInfoEnum.XueLi.xl003.getValue());
        }else if ("xl004".equals(jinYaoDaiParam.getXueli())){
            userDataParam.setXueli(BaseTypeInfoEnum.XueLi.xl004.getValue());
        }else {
            userDataParam.setXueli(BaseTypeInfoEnum.XueLi.xl005.getValue());
        }

        if (StringUtils.isEmpty(jinYaoDaiParam.getSalary())){
            userDataParam.setShouru(BaseTypeInfoEnum.Shouru.sr001.getValue());
        }else if ("sa001".equals(jinYaoDaiParam.getSalary())){
            userDataParam.setShouru(BaseTypeInfoEnum.Shouru.sr001.getValue());
        }else if ("sa002".equals(jinYaoDaiParam.getSalary())){
            userDataParam.setShouru(BaseTypeInfoEnum.Shouru.sr002.getValue());
        }else {
            userDataParam.setShouru(BaseTypeInfoEnum.Shouru.sr004.getValue());
        }

        userDataParam.setBaitiao(BaseTypeInfoEnum.Baitiao.bt001.getValue());

        userDataParam.setHuabei(BaseTypeInfoEnum.Huabei.hb001.getValue());

//        if (StringUtils.isEmpty(jinYaoDaiParam.getBaitiao())){
//            userDataParam.setBaitiao(BaseTypeInfoEnum.Baitiao.bt001.getValue());
//        }else if ("bt001".equals(jinYaoDaiParam.getBaitiao())){
//            userDataParam.setBaitiao(BaseTypeInfoEnum.Baitiao.bt001.getValue());
//        }else if ("bt002".equals(jinYaoDaiParam.getBaitiao()) || "bt003".equals(jinYaoDaiParam.getBaitiao())){
//            userDataParam.setBaitiao(BaseTypeInfoEnum.Baitiao.bt002.getValue());
//        }else {
//            userDataParam.setBaitiao(BaseTypeInfoEnum.Baitiao.bt003.getValue());
//        }
//
//        if (StringUtils.isEmpty(jinYaoDaiParam.getHuabei())){
//            userDataParam.setHuabei(BaseTypeInfoEnum.Huabei.hb001.getValue());
//        }else if ("hb001".equals(jinYaoDaiParam.getHuabei())){
//            userDataParam.setHuabei(BaseTypeInfoEnum.Huabei.hb001.getValue());
//        }else if ("hb002".equals(jinYaoDaiParam.getHuabei()) || "hb003".equals(jinYaoDaiParam.getHuabei())){
//            userDataParam.setHuabei(BaseTypeInfoEnum.Huabei.hb002.getValue());
//        }else {
//            userDataParam.setHuabei(BaseTypeInfoEnum.Huabei.hb003.getValue());
//        }

        if (StringUtils.isNotEmpty(jinYaoDaiParam.getUserIp())){
            userDataParam.setUserIp(jinYaoDaiParam.getUserIp());
        }else {
            userDataParam.setUserIp("127.0.0.1");
        }


        if (StringUtils.isEmpty(jinYaoDaiParam.getLoanAmount())){
            userDataParam.setLoanAmount(BaseTypeInfoEnum.LoanAmount.la001.getValue());
        }else {
            if ("la001".equals(jinYaoDaiParam.getLoanAmount())) {
                userDataParam.setLoanAmount(BaseTypeInfoEnum.LoanAmount.la001.getValue());
            } else if ("la002".equals(jinYaoDaiParam.getLoanAmount())) {
                userDataParam.setLoanAmount(BaseTypeInfoEnum.LoanAmount.la002.getValue());
            } else {
                userDataParam.setLoanAmount(BaseTypeInfoEnum.LoanAmount.la003.getValue());
            }
        }

        String houseProperty = jinYaoDaiParam.getHouse();
        if ("hu001".equals(houseProperty)){
            userDataParam.setHouse(BaseTypeInfoEnum.House.hu001.getValue());
        }else if ("hu002".equals(houseProperty)){
            userDataParam.setHouse(BaseTypeInfoEnum.House.hu003.getValue());
        }else {
            userDataParam.setHouse(BaseTypeInfoEnum.House.hu002.getValue());
        }

        String commercialInsurance = jinYaoDaiParam.getBaoxian();
        if ("bd001".equals(commercialInsurance)){
            userDataParam.setBaoxian(BaseTypeInfoEnum.Baoxian.bx001.getValue());
        }else if ("bd002".equals(commercialInsurance)){
            userDataParam.setBaoxian(BaseTypeInfoEnum.Baoxian.bx002.getValue());
        }else {
            userDataParam.setBaoxian(BaseTypeInfoEnum.Baoxian.bx003.getValue());
        }

        String creditCardLimit = jinYaoDaiParam.getYuqi();
        if ("yq001".equals(creditCardLimit)){
            userDataParam.setYuqi(BaseTypeInfoEnum.Yuqi.yq001.getValue());
        }else if ("yq002".equals(creditCardLimit)){
            userDataParam.setYuqi(BaseTypeInfoEnum.Yuqi.yq003.getValue());
        }else if ("yq003".equals(creditCardLimit)){
            userDataParam.setYuqi(BaseTypeInfoEnum.Yuqi.yq004.getValue());
        }else {
            userDataParam.setYuqi(BaseTypeInfoEnum.Yuqi.yq005.getValue());
        }

        String hasFund = jinYaoDaiParam.getGjj();
        if ("gjj001".equals(hasFund)){
            userDataParam.setGjj(BaseTypeInfoEnum.Gjj.gjj001.getValue());
        }else if ("gjj002".equals(hasFund)){
            userDataParam.setGjj(BaseTypeInfoEnum.Gjj.gjj002.getValue());
        }else {
            userDataParam.setGjj(BaseTypeInfoEnum.Gjj.gjj003.getValue());
        }

        String zhimaCredit = jinYaoDaiParam.getZhimaSource();
        if ("zm005".equals(zhimaCredit)){
            userDataParam.setZhima(BaseTypeInfoEnum.Zhima.zm005.getValue());
        }else if ("zm004".equals(zhimaCredit)){
            userDataParam.setZhima(BaseTypeInfoEnum.Zhima.zm004.getValue());
        }else if ("zm003".equals(zhimaCredit)){
            userDataParam.setZhima(BaseTypeInfoEnum.Zhima.zm003.getValue());
        }else if ("zm002".equals(zhimaCredit)){
            userDataParam.setZhima(BaseTypeInfoEnum.Zhima.zm002.getValue());
        }else {
            userDataParam.setZhima(BaseTypeInfoEnum.Zhima.zm001.getValue());
        }

        String hasSocial = jinYaoDaiParam.getShebao();
        if ("sb001".equals(hasSocial)){
            userDataParam.setShebao(BaseTypeInfoEnum.Shebao.sb001.getValue());
        }else if ("sb002".equals(hasSocial)){
            userDataParam.setShebao(BaseTypeInfoEnum.Shebao.sb002.getValue());
        }else {
            userDataParam.setShebao(BaseTypeInfoEnum.Shebao.sb003.getValue());
        }

        String carProperty = jinYaoDaiParam.getCar();
        if ("car001".equals(carProperty)){
            userDataParam.setCar(BaseTypeInfoEnum.Car.car001.getValue());
        }else if ("car002".equals(carProperty)){
            userDataParam.setCar(BaseTypeInfoEnum.Car.car002.getValue());
        }else {
            userDataParam.setCar(BaseTypeInfoEnum.Car.car003.getValue());
        }

        String professional = jinYaoDaiParam.getGongzuo();
        if ("job001".equals(professional)){
            userDataParam.setGongzuo(BaseTypeInfoEnum.Gongzuo.gz001.getValue());
        }else if ("job002".equals(professional)){
            userDataParam.setGongzuo(BaseTypeInfoEnum.Gongzuo.gz002.getValue());
        }else if ("job003".equals(professional)){
            userDataParam.setGongzuo(BaseTypeInfoEnum.Gongzuo.gz003.getValue());
        }else{
            userDataParam.setGongzuo(BaseTypeInfoEnum.Gongzuo.gz005.getValue());
        }

        String loanTerm = jinYaoDaiParam.getLoanTime();
        if ("lt001".equals(loanTerm)){
            userDataParam.setLoanTime(BaseTypeInfoEnum.LoanTime.lt002.getValue());
        }else if ("lt002".equals(loanTerm)){
            userDataParam.setLoanTime(BaseTypeInfoEnum.LoanTime.lt003.getValue());
        }else{
            userDataParam.setLoanTime(BaseTypeInfoEnum.LoanTime.lt004.getValue());
        }
        return userDataParam;
    }

    public static JSONObject getSuccess1(String requestNo) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("requestNo",requestNo);
        jsonObject.put("respCode","200");
        jsonObject.put("respMsg","请求成功");
        JSONObject returnObject = new JSONObject();
        returnObject.put("status", "000");
        returnObject.put("message", "推送成功");
        returnObject.put("orderNo", UUID.randomUUID().toString());
        jsonObject.put("respData",returnObject);
        return jsonObject;
    }

    public static JSONObject getError1(String requestNo ,String message) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("requestNo",requestNo);
        jsonObject.put("respCode","500");
        jsonObject.put("respMsg",message);
        JSONObject respData = new JSONObject();
        jsonObject.put("respData",respData);
        return jsonObject;
    }

}
